﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;

namespace ToolExcelPub
{
    public static partial class XTool
    {
        public static Action<object> ActionShowInfo = null;
        public static Action<object> ActionShowError1 = null;
        public static Action<object, object> ActionShowError2 = null;

        public static void ShowInfo(object obj)
        {
            if (ActionShowInfo != null)
            {
                ActionShowInfo.Invoke(obj);
            }
        }
        public static void ShowError(object obj)
        {
            if (ActionShowError1 != null)
            {
                ActionShowError1.Invoke(obj);
            }
            if (ActionShowError2 != null)
            {
                ActionShowError2.Invoke(obj, "提示");
            }
        }
        public static void ShowError(object obj1, object obj2)
        {
            if (ActionShowError1 != null)
            {
                ActionShowError1.Invoke(obj1);
            }
            if (ActionShowError2 != null)
            {
                ActionShowError2.Invoke(obj1, obj2);
            }
        }
        public static void SetInfo(Action<object> act)
        {
            ActionShowInfo = act;
        }
        public static void SetError(Action<object> act)
        {
            ActionShowError1 = act;
        }
        public static void SetError(Action<object, object> act)
        {
            ActionShowError2 = act;
        }

    }
}
